

#include <iostream>
#include <thread>
#include <Proxy.h>
#include <message.h>
#include <Parcel.h>
#include "media.h"

int status = 0;
int main() {
    std::thread t(&init, std::ref(status));
    while (!status)
    {
        std::this_thread::yield();
    }
    std::cout<<"status is ok"<<std::endl;
    // message msg;
    Media md;
    md.setFilename("house-of-card-s1e1.txt");
    // msg.setmsg("filename", "house-of-card-s1e1.txt");
    Parcel& pc = Parcel::GetInstance();
    int ret = pc.send(md);
    std::cout<<"ret = "<<ret<<std::endl;
    //md = pc.receive();
    std::cout<<"recive from server: "<<md.getFilename()<<std::endl;

    t.join();
    return 0;
}
